package com.ruoyi.oss.config;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

public class Test {

    public static void main(String[] args) {
        String a = "{\"doMain\":\"\",\"enableStorage\":\"y\",\"platformKey\":\"local-windows\",\"basePath\":\"/service-oos/download/\",\"platformType\":\"LocalPlusFileStorage\",\"platformAttr\":{\"@type\":\"com.zerone.oss.model.attr.LocalPlusConfig\",\"storagePath\":\"d:/tmp\",\"pathPatterns\":\"\"},\"platformName\":\"Windows本地存储\"}";
        JSONObject jsonObject = (JSONObject) JSON.parse(a);
//        System.out.println(jsonObject.toJavaObject(UpdateStoragePlatformVo.class));
        //        ParserConfig.getGlobalInstance().setAutoTypeSupport(true);
//        ParserConfig.getGlobalInstance().addAutoTypeCheckHandler((typeName, expectClass, features) -> {
//            try {
//                return Class.forName(typeName);
//            } catch (ClassNotFoundException e) {
//                e.printStackTrace();
//            }
//            return expectClass;
//        });
//        System.out.println(JSON.parseObject(a, UpdateStoragePlatformVo.class, Feature.DisableSpecialKeyDetect));
    }
}
